import { defineStore} from 'pinia'
import { getCurrentAdmin } from '@/apis/common'

export const useAdminStore = defineStore('admin', {
  state: () => ({
   adminInfo: {
    nickName: '',
    avatar: '',
   }
  }),
  actions: {
    async setAdminInfo(){
      try{
        const res = await getCurrentAdmin()
        this.adminInfo = res.data.data
      }catch(error){
        console.log(error)
      }
    }
  }
});
